<script>
export default {
  name: "ReportInfo",
  props: {
    data: {
      type: Array,
      default: () => [],
    },
  },
  methods: {
    getContentChild(content, key) {
      return content[key] && content[key].length > 0;
    },
  },
};
</script>

<template>
  <div v-if="data" class="accountInfo-box">
    <JSONText :item="data"></JSONText>
    <div class="content">
      <div v-for="item in data" :key="item.value" class="content-item">
        <span class="content-label">{{ item.title }}</span>
        <span class="content-value">{{ item.value }}</span>
      </div>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.accountInfo-box {
  width: 800px;
}

.accountInfo-box {
  $bg-color-1: #15465f;
  $font-color-1: #5ae1fe;
  $font-color-2: #ffffff;
  $font-color-3: #666666;

  .content {
    font-size: 16px;

    .content-item {
      margin-bottom: 8px;

      &:last-child {
        margin-bottom: 0px;
      }

      .content-label {
        display: inline-block;
        width: 120px;
        vertical-align: baseline;
        color: #666666;
      }

      .content-value {
        max-width: calc(100% - 140px);
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: top;
        white-space: nowrap;
        display: inline-block;
      }
    }
  }
}
</style>
